/*
package cn.school.mybatis.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;

@WebFilter("/*")
public class IEFilter implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
//        resp.setContentType("text/html;charset=UTF-8");
//        PrintWriter out = resp.getWriter();
//        HttpServletRequest request= (HttpServletRequest) req;
//        String agent = request.getHeader("user-agent");
//        System.out.println(agent);
//        StringTokenizer st = new StringTokenizer(agent, ";");
//        String userBrowser = st.nextToken();// 得到用户的浏览器名
//        String userOS = st.nextToken();// 得到用户的操作系统名
//        System.out.println("用户的浏览器名:"+userBrowser);
//        System.out.println("用户的操作系统名:"+userOS);
//        if (userBrowser.indexOf("IE")>=0){
//            System.out.println("禁止使用IE浏览器访问!");
//            out.println("<script>alert('禁止使用IE浏览器访问！\n您的浏览器信息："+userBrowser+"');");
//        }
        chain.doFilter(req, resp);
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
*/
